<script>
    export default{
      methods: {
        login() {
          this.$router.push({path: '/login', query: {name: 'admin'}})
        },
      }
    }
</script>

<template>
  <div>
    <nav class="navigation">
      <router-link :to="{name: 'login', query: {name: 'admin'}}">query登录</router-link><br>
      <router-link :to="{name: 'loginByParams', params: {name: 'admin'}}">params登录</router-link>
      <button @click="login">函数式跳转</button>
    </nav>
    <router-view></router-view>
  </div>
</template>

<style scoped>
  .navigation {
    
  }
</style>